//
//  ViewController.m
//  test
//
//  Created by Mac on 15/11/27.
//  Copyright © 2015年 jacky. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIWebView *web=[[UIWebView alloc]init];
    UIScreen *screen=[UIScreen mainScreen];
    web.frame=screen.bounds;
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        //耗时的操作
//            UIImageView *image=[[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
//            NSURL *url=[NSURL URLWithString:@"https://git.oschina.net/logo.gif"];
//            NSData *data=[NSData dataWithContentsOfURL:url];
//            UIImage *imagename=[UIImage imageWithData:data];
            
            
            NSURL *url=[NSURL URLWithString:@"https://git.oschina.net/liyj2015/"];
            NSURLRequest *request=[NSURLRequest requestWithURL:url];
            [web loadRequest:request];
            sleep(2);

        dispatch_async(dispatch_get_main_queue(), ^{
            //更新界面
//            image.image=imagename;
//            [self.view addSubview:image];
            [self.view addSubview:web];
        });
    });
    
   
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
